<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta name="description" content="人寿保险">
    <title>{{title}}</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">

    {% block css %}
    <style type="text/css">
    .active {background:#ff0;}
    </style>
    {% endblock %}
  </head>
  <body>

    {% block header %}
    <header>
        <a href="/">首页</a>
        {% if login %}
            {% if user.type == 2%}
            <a href="/create/user">添加用户</a>
            <a href="/create/company">添加公司</a>
            {% endif %}
        <a href="/logout">登出</a>
        {% else %}
        <a href="/login">登陆</a>
        {% endif %}
        <a href="/contacts">联系我们</a>
    </header>
    {% endblock%}

    {% block menu %}
    <ul>
        {% if can_overview %}
        <li {% if not active_company_id %} class='active' {% endif %} ><a href="/">案件总览></a></li>
        {% endif %}
        {% for company in branch_companys %}
        <li {% if company.id == active_company_id and 'statistics' == active_type %} class='active' {% endif %}>
            <a href="/{{company.id}}">{{company.name}}></a>
        </li>
        <li {% if company.id == active_company_id and 'finished' == active_type %} class='active' {% endif %}>
            <a href="/company/{{company.id}}/finished_cases">已结案件></a>
        </li>
        <li {% if company.id == active_company_id and 'unfinished' == active_type %} class='active' {% endif %}>
            <a href="/company/{{company.id}}/unfinished_cases">未结案件></a>
        </li>
        <li {% if company.id == active_company_id and 'create' == active_type %} class='active' {% endif %}>
            <a href="/create/company/{{company.id}}/case">创建案件></a>
        </li>
        {% endfor %}
    </ul>
    {% endblock %}

    {% block content %}
    {% endblock %}

    {% block footer %}
    {% endblock %}

    <script src="/static/js/jquery.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    {% block js %}
    {% endblock %}
  </body>
</html>
